/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.siga.modelo.entidad;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author karolyn
 */
@Entity
@Table(name = "Curso")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Curso.findAll", query = "SELECT c FROM Curso c"),
    @NamedQuery(name = "Curso.findByCodCurso", query = "SELECT c FROM Curso c WHERE c.codCurso = :codCurso"),
    @NamedQuery(name = "Curso.findByDescCurso", query = "SELECT c FROM Curso c WHERE c.descCurso = :descCurso"),
    @NamedQuery(name = "Curso.findByHoraTeoria", query = "SELECT c FROM Curso c WHERE c.horaTeoria = :horaTeoria"),
    @NamedQuery(name = "Curso.findByHoraPractica", query = "SELECT c FROM Curso c WHERE c.horaPractica = :horaPractica"),
    @NamedQuery(name = "Curso.findByCreditos", query = "SELECT c FROM Curso c WHERE c.creditos = :creditos"),
    @NamedQuery(name = "Curso.findByActivo", query = "SELECT c FROM Curso c WHERE c.activo = :activo")})
public class Curso implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "codCurso")
    private String codCurso;
    @Column(name = "descCurso")
    private String descCurso;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "horaTeoria")
    private BigDecimal horaTeoria;
    @Column(name = "horaPractica")
    private BigDecimal horaPractica;
    @Column(name = "creditos")
    private Integer creditos;
    @Column(name = "activo")
    private Boolean activo;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "curso")
    private Collection<DetallePlan> detallePlanCollection;

    public Curso() {
    }

    public Curso(String codCurso) {
        this.codCurso = codCurso;
    }

    public String getCodCurso() {
        return codCurso;
    }

    public void setCodCurso(String codCurso) {
        this.codCurso = codCurso;
    }

    public String getDescCurso() {
        return descCurso;
    }

    public void setDescCurso(String descCurso) {
        this.descCurso = descCurso;
    }

    public BigDecimal getHoraTeoria() {
        return horaTeoria;
    }

    public void setHoraTeoria(BigDecimal horaTeoria) {
        this.horaTeoria = horaTeoria;
    }

    public BigDecimal getHoraPractica() {
        return horaPractica;
    }

    public void setHoraPractica(BigDecimal horaPractica) {
        this.horaPractica = horaPractica;
    }

    public Integer getCreditos() {
        return creditos;
    }

    public void setCreditos(Integer creditos) {
        this.creditos = creditos;
    }

    public Boolean getActivo() {
        return activo;
    }

    public void setActivo(Boolean activo) {
        this.activo = activo;
    }

    @XmlTransient
    public Collection<DetallePlan> getDetallePlanCollection() {
        return detallePlanCollection;
    }

    public void setDetallePlanCollection(Collection<DetallePlan> detallePlanCollection) {
        this.detallePlanCollection = detallePlanCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codCurso != null ? codCurso.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Curso)) {
            return false;
        }
        Curso other = (Curso) object;
        if ((this.codCurso == null && other.codCurso != null) || (this.codCurso != null && !this.codCurso.equals(other.codCurso))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.siga.modelo.entidad.Curso[ codCurso=" + codCurso + " ]";
    }
    
}
